#ifndef __INODE_H__
#define	__INODE_H__

#include "indirectblock.h"
#include "block.h"
#include "types.h"
#include <time.h>
#include <vector>




#define INODE_SIZE 64
#define INODE_DATALIST_SIZE 13
#define INODE_DATABLOCK_SIZE 3

struct inode_t
{
	//unsigned short modeTypeFile;
	//byte modeTypeFile[2];
    unsigned char modeTypeFile[USHORT];
    unsigned char numberOfLinks[USHORT];
    unsigned char ownerUserId[USHORT];
    unsigned char groupUserId[USHORT];
    unsigned char fileSize[UINT];
    unsigned char dataBlockAddresses[INODE_DATALIST_SIZE][INODE_DATABLOCK_SIZE];
    unsigned char alignByte;
    unsigned char lastAccessed[UINT];
    unsigned char lastModified[UINT];
    unsigned char lastChanged[UINT];
};




class Inode : public Block
{
	private:
		inode_t * inode;
		IndirectBlock * ind1;
		IndirectBlock * ind2;
		IndirectBlock * ind3;

	public:
		Inode(FILE*, unsigned long);
		virtual ~Inode();

		ulong getModeTypeFile();
		ulong getNumberOfLinks();
		ulong getOwnerUserId();
		ulong getGroupUserId();
		ulong getFileSize();
		ulong * getDataBlockAdresses();
		ulong getLastAccessed();
		char * getLastAccessedAsString();
		ulong getLastModified();
		char * getLastModifiedAsString();
		ulong getLastChanged();
		char * getLastChangedAsString();
		std::vector<long> * getAllDataBlockAdresses();
		virtual void print();
};

#endif

